package com.unidt.www.module.expert.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.unidt.www.framework.mybatis.core.mapper.BaseMapperX;
import com.unidt.www.module.expert.domain.ExpertInfoDo;
import com.unidt.www.module.expert.dto.RuleQueryDto;
import com.unidt.www.module.expert.vo.ExpertUserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ExpertInfoMapper extends BaseMapperX<ExpertInfoDo> {

    default  Long countByIdCard(String idCard){
        LambdaQueryWrapper<ExpertInfoDo> lambdaQueryWrapper   =
                new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(ExpertInfoDo::getIdCard,idCard);
        lambdaQueryWrapper.eq(ExpertInfoDo::getDeleted,false);
        return this.selectCount(lambdaQueryWrapper);
    };

    List<ExpertUserVo> selectListByRule(@Param(value = "ruleQueryDto") RuleQueryDto ruleQueryDto);
}
